package com.liudehua.boot.service;

import com.liudehua.boot.interfaces.RedisInterface;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;

@DubboService
public class RedisService implements RedisInterface {
    @Autowired
    public RedisTemplate redisTemplate;

    @Override
    public String get(String key) {
       return (String) redisTemplate.opsForValue().get(key);
    }

    @Override
    public void put(String key, String value) {
        redisTemplate.opsForValue().set(key,value);
    }
}
